Skip to content

Make the wizard dashboard runtime-configurable - #167

Merged
pelikhan merged 6 commits into
mainfrom
copilot/refactor-dashboard-data-driven
Aug 27, 2026
Merged

Make the wizard dashboard runtime-configurable#167
pelikhan merged 6 commits into
mainfrom
copilot/refactor-dashboard-data-driven

Conversation

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

The wizard’s content and presentation were embedded in JavaScript and HTML, preventing reuse outside this repository. This change moves customization into a runtime JSON contract.

Changes

  • Runtime configuration

    • Adds wizard.json for choices, summaries, archetype ordering, recommendations, and data endpoints.
    • Emits the configuration as a standalone build asset that can be edited without rebuilding JavaScript.
  • Data-driven rendering

    • Generates trigger, output, capability, engine, and archetype cards from configuration.
    • Uses configured metadata for summaries and recommendation resolution.
    • Handles configuration-loading failures without masking rendering errors.
  • Third-party integration

    • Supports configuration selection through metadata or initWizard({ configUrl }).
    • Resolves pattern and engine sources relative to the configuration URL.
    • Documents hosting and customization from another repository.
<meta name="gh-aw-wizard-config" content="wizard.json">

Copilot AI and others added 4 commits August 27, 2026 15:17
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Refactor wizard dashboard to runtime JSON configuration Make the wizard dashboard runtime-configurable Aug 27, 2026
Copilot AI requested a review from pelikhan August 27, 2026 15:25
@pelikhan
pelikhan marked this pull request as ready for review August 27, 2026 15:53

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: matt-pocock (TypeScript/JS-focused — this PR is a pure JS refactor moving hardcoded config into wizard.json).

Overall the data-driven refactor is clean: wizard-config.js is small and well-tested, patterns.js/summary.js correctly thread the new wizardConfig param through, and vite.config.js correctly emits wizard.json as a build asset. Left one actionable inline comment on src/js/ui.js about an unhandled-rejection gap in initWizard where a failed patterns_url/engines_url load (unlike a failed configUrl load) has no user-visible fallback. No other blocking issues found in the diff.

Generated by Specialist PR Review for #167 · auto · 49.6 AIC · ⌖ 1.74 AIC · ⊞ 7.9K

Comment thread src/js/ui.js
Comment on lines +48 to +65
const ready = loadWizardConfig(configUrl).catch(() => {
return null;
}).then((config) => {
if (!config) {
const container = document.getElementById('archetype-options');
if (container) {
container.setAttribute('role', 'status');
container.textContent = 'Unable to load the wizard configuration.';
}
return null;
}
wizardConfig = config;
const patternsUrl = resolveWizardAssetUrl(config.patterns_url, configUrl);
const enginesUrl = resolveWizardAssetUrl(config.engines_url, configUrl);
return Promise.all([
loadPatterns(patternsUrl),
loadDefinitionEngines(opts.fetch, enginesUrl)
]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loadWizardConfig(...).catch(...) only guards the config fetch. If loadPatterns(patternsUrl) or loadDefinitionEngines(...) reject (e.g. wizard.json loads but patterns_url/engines_url is unreachable or 404s), the returned ready promise rejects with no .catch, producing an unhandled rejection and leaving the UI in the "loading" state with no user-visible error — unlike the config-load failure path just above, which does show "Unable to load the wizard configuration.". Consider wrapping this Promise.all(...) (or the whole chain) in a .catch that surfaces the same kind of status message, so a broken patterns_url/engines_url fails as gracefully as a broken configUrl.

@pelikhan

Copy link
Copy Markdown
Collaborator

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot also allow to configure the text content of the landing page items, button, footer URLs

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix https://github.com/githubnext/gh-aw-wizard/actions/runs/33087708412/job/98581032194#step:5:1

Fixed in db67bc5. Restored the curated archetype safeguards required by the prompt-generation tests; all 196 tests and the build now pass.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

@copilot also allow to configure the text content of the landing page items, button, footer URLs

Implemented in 88c065f. wizard.json now configures the landing title, message, button, hint, diagram labels, and footer labels/URLs; relative URLs resolve from the config location and unsafe schemes are rejected.

@pelikhan
pelikhan merged commit 03c142d into main Aug 27, 2026
8 checks passed
@pelikhan
pelikhan deleted the copilot/refactor-dashboard-data-driven branch August 27, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants